Integral image as an intermediate image representation can be used to calculate the sum of gray level in rectangle quickly. A novel partial matching error function was presented based on sub block mean. 根据积分图像对匹配误差函数进行变形,提出了一种新的局部匹配误差函数&基于子块均值的匹配误差函数。